<!--{eval $_G['home_tpl_titles'] = array('{lang feed}');}-->
<!--{if empty($diymode)}-->
{subtemplate common/header}

<div id="pt" class="wp">
	<a href="index.php" class="nvhm">$_G[setting][bbname]</a> &rsaquo;
	<a href="$_G[setting][navs][4][filename]">$_G[setting][navs][4][navname]</a>
</div>
<style id="diy_style" type="text/css"></style>
<div class="wp">
	<!--[diy=diy1]--><div id="diy1" class="area"></div><!--[/diy]-->
</div>
<div id="ct" class="wp cl">
	<div class="mn cl">
		<div class="frame-3-1 cl">
			<div class="col-r">
				<!--{if $defaultusers}-->
					<div class="bn">
						<h2>{lang friends_recommended}</h2>
						<ul class="ml mls cl">
							<!--{loop $defaultusers $key $value}-->
							<li>
								<a href="home.php?mod=space&uid=$value[uid]" title="{if $ols[$value[uid]]}{lang online}{/if}" class="avt">
									<!--{if $ols[$value[uid]]}--><em class="gol"></em><!--{/if}-->
									<!--{avatar($value[uid],small)}-->
								</a>
								<p><a href="home.php?mod=space&uid=$value[uid]" title="$value[username]">$value[username]</a></p>
							</li>
							<!--{/loop}-->
						</ul>
					</div>
				<!--{/if}-->

				<!--{if $visitorlist}-->
					<div class="bn">
						<span class="y">
							<!--{if $_G[setting][magics][visit]}-->
							<span class="xg1"><img src="{STATICURL}image/magic/visit.small.gif" title="{$_G[setting][magics][visit]}" class="vm" /> <a id="a_magic_visit" href="home.php?mod=magic&mid=visit" onclick="showWindow('magics',this.href,'get', 0)">{$_G[setting][magics][visit]}</a></span>
							<!--{/if}-->
							<a href="home.php?mod=space&uid=$space[uid]&do=friend&view=visitor">{lang all}</a>
						</span>
						<h2>{lang recent_visit}</h2>
						<ul class="ml mls cl">
							<!--{loop $visitorlist $key $value}-->
							<li>
								<!--{if $value[vusername] == ''}-->
								<div class="avt"><img src="{STATICURL}image/magic/hidden.gif" alt="{lang anonymity}" /></div>
								<p>{lang anonymity}</p>
								<span><!--{date($value[dateline], 'u', 9999, $_G[setting][dateformat])}--></span>
								<!--{else}-->
								<a href="home.php?mod=space&uid=$value[vuid]" title="{if $ols[$value[vuid]]}{lang online}{/if}">
									<!--{if $ols[$value[vuid]]}--><em class="gol"></em><!--{/if}-->
									<!--{avatar($value[vuid],small)}-->
								</a>
								<p><a href="home.php?mod=space&uid=$value[vuid]" title="$value[vusername]">$value[vusername]</a></p>
								<span><!--{date($value[dateline], 'u', 9999, $_G[setting][dateformat])}--></span>
								<!--{/if}-->
							</li>
							<!--{/loop}-->
						</ul>
					</div>
				<!--{/if}-->
			
				<!--{if $olfriendlist}-->
					<div class="bn">
						<p class="y">
							<a href="home.php?mod=space&uid=$space[uid]&do=friend">{lang all}</a>
						</p>
						<h2>{lang my_friends}</h2>
						<ul class="ml mls cl">
							<!--{loop $olfriendlist $key $value}-->
							<li>
								<a href="home.php?mod=space&uid=$value[uid]" title="{if $ols[$value[uid]]}{lang online}{/if}" class="avt">
									<!--{if $ols[$value[uid]]}--><em class="gol"></em><!--{/if}-->
									<!--{avatar($value[uid],small)}-->
								</a>
								<p><a href="home.php?mod=space&uid=$value[uid]" title="$value[username]">$value[username]</a></p>
								<span><!--{if $value[lastactivity]}--><!--{date($value[lastactivity], 'u', 9999, $_G[setting][dateformat])}--><!--{else}-->{lang hot}($value[num])<!--{/if}--></span>
							</li>
							<!--{/loop}-->
						</ul>
					</div>
				<!--{/if}-->

				<div class="drag">
					<!--[diy=diy2]--><div id="diy2" class="area"></div><!--[/diy]-->
				</div>

				<!--{if $birthlist}-->
					<div class="bn">
						<h2>{lang friends_birthday_reminder}</h2>
						<table cellpadding="2" cellspacing="4">
						<!--{loop $birthlist $key $values}-->
						<tr>
							<td align="right" valign="top">
							<!--{if $values[0]['istoday']}-->{lang today}<!--{else}-->{$values[0][birthmonth]}-{$values[0][birthday]}<!--{/if}-->
							</td>
							<td style="padding-left:10px;">
								<ul>
								<!--{loop $values $value}-->
								<li><a href="home.php?mod=space&uid=$value[uid]">$value[username]</a></li>
								<!--{/loop}-->
								</ul>
							</td>
						</tr>
						<!--{/loop}-->
						</table>
					</div>
				<!--{/if}-->

				{hook/space_home_side_bottom}
			</div>
	
		<div class="col-l">
			<!--{if $space['uid'] && $space[self]}-->
			<div class="mi">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<th class="hm">
							<div class="avt"><!--{avatar($_G[uid],middle)}--></div>
							<p class="mbm">
								<a href="home.php?mod=space&uid=$space[uid]" target="_blank" class="o">{lang view_my_space}</a>
								<a href="home.php?mod=spacecp" id="usettingli" class="xg1" onmouseover="showMenu(this.id)">{lang setup}</a>
							</p>
							<ul id="usettingli_menu" class="p_pop" style="width: 80px; display:none;">
								<li><a href="home.php?mod=spacecp&ac=avatar">{lang edit_avatar}</a></li>
								<li><a href="home.php?mod=spacecp&ac=profile">{lang memcp_profile}</a></li>
								<li><a href="home.php?mod=spacecp&ac=credit">{lang my_credits}</a></li>													
								<li><a href="home.php?mod=spacecp&ac=privacy">{lang privacy_filter}</a></li>
								<!--{if $_G['setting'][sendmailday]}-->
								<li><a href="home.php?mod=spacecp&ac=sendmail">{lang email_reminder}</a></li>
								<!--{/if}-->
								<!--{if checkperm('allowstat')}-->
								<li><a href="home.php?mod=misc&ac=stat">{lang trends_and_statistics}</a></li>
								<!--{/if}-->
							</ul>
						</th>
						<td>
							<h3 class="xs2">
								<a href="home.php?mod=space&uid=$space[uid]"{eval g_color($space[groupid]);}>{$space[username]}</a>
								<!--{eval g_icon($space[groupid]);}-->
							</h3>
							<p class="mtn xg1 cl">
								{eval $space[domainurl] = space_domain($space);}
								{lang have} <a href="home.php?mod=spacecp&ac=credit">$space[credits]</a> {lang a_credit}, {lang usergroup}:<a href="home.php?mod=spacecp&ac=credit&op=usergroup"><!--{eval g_name($space[groupid]);}--></a>
							</p>
							<!--{template home/space_status}-->
						</td>
					</tr>
				</table>
				{hook/space_home_top}

				<!--{if $space['newprompt']}-->
					<ul class="mipm cl">
					<!--{if $space[notifications]}--><li class="brm"><img src="{STATICURL}image/feed/notice.gif" alt="notice" class="vm" /><a href="home.php?mod=space&do=notice"><strong>$space[notifications]</strong> {lang a_notice}</a></li><!--{/if}-->
					<!--{if $space[pendingfriends]}--><li class="brm"><img src="{STATICURL}image/feed/friend.gif" alt="friend" class="vm" /><a href="home.php?mod=spacecp&ac=friend&op=request"><strong>$space[pendingfriends]</strong> {lang a_friend_request}</a></li><!--{/if}-->
					<!--{if $space[groupinvitations]}--><li class="brm"><img src="{STATICURL}image/feed/mtag.gif" alt="mtag" class="vm" /><a href="home.php?mod=space&do=notice&type=group"><strong>$space[groupinvitations]</strong> {lang a_group_invite}</a></li><!--{/if}-->
					<!--{if $space[activityinvitations]}--><li class="brm"><img src="{STATICURL}image/feed/event.gif" alt="event" class="vm" /><a href="home.php?mod=spacecp&ac=event&op=eventinvite"><strong>$space[activityinvitations]</strong> {lang a_activity_invite}</a></li><!--{/if}-->
					<!--{if $space[myinvitations]}--><li class="brm"><img src="{STATICURL}image/feed/userapp.gif" alt="userapp" class="vm" /><a href="home.php?mod=space&do=notice&view=userapp"><strong>$space[myinvitations]</strong> {lang a_userapp}</a></li><!--{/if}-->
					<!--{if $space[pokes]}--><li class="brm"><img src="{STATICURL}image/feed/poke.gif" alt="poke" class="vm" /><a href="home.php?mod=spacecp&ac=poke"><strong>$space[pokes]</strong> {lang a_new_poke}</a></li><!--{/if}-->
					{hook/space_home_promptlink}
					</ul>
				<!--{/if}-->
			</div>

			{ad/feed/bm}

			<div class="bm">
				<ul class="tb cl">
					<li$actives[we]><a href="home.php?mod=space&do=home&view=we">{lang friend_feed}</a></li>
					<li$actives[me]><a href="home.php?mod=space&do=home&view=me">{lang my_feed}</a></li>
					<li$actives[all]><a href="home.php?mod=space&do=home&view=all">{lang view_all}</a></li>
					{hook/space_home_navlink}
					<!--{if $_G[setting][magics][thunder]}-->
					<li class="y"><a id="a_magic_thunder" href="home.php?mod=magic&mid=thunder" onclick="showWindow('magics', this.href, 'get', 0)"><img src="{STATICURL}image/magic/thunder.small.gif" alt="{$_G[setting][magics][thunder]}" class="vm" /> {$_G[setting][magics][thunder]}</a></li>
					<!--{/if}-->
				</ul>

			<!--{else}-->
				<div class="bm">
				<!--{eval
					$_G['home_tpl_spacemenus'][] = "<a href=\"home.php?mod=space&uid=$space[uid]&do=home&view=me\">{lang they_feed}</a>";
				}-->
				<!--{template home/space_menu}-->

			<!--{/if}-->

			<!--{if $_GET[view] == 'all'}-->
				<p class="tbmu">
					<a href="home.php?mod=space&do=home&view=all&order=dateline"$orderactives[dateline]>{lang newest_feed}</a><span class="pipe">|</span>
					<a href="home.php?mod=space&do=home&view=all&order=hot"$orderactives[hot]>{lang hot_feed}</a>
				</p>
			<!--{elseif $groups}-->
				<p class="tbmu">
					<a href="home.php?mod=space&do=home&view=we"{$gidactives[-1]}>{lang all_friends}</a>
					<!--{loop $groups $key $value}-->
					<span class="pipe">|</span><a href="home.php?mod=space&do=home&view=we&gid=$key"{$gidactives[$key]}>$value</a>
					<!--{/loop}-->
				</p>
			<!--{/if}-->

<!--{else}-->

<!--{template home/space_header}-->
<div id="ct" class="wp n cl">
	<div class="mn">
		<div class="bm">
			<h1 class="mt">{lang feed}</h1>
<!--{/if}-->

			<div id="feed_div" class="e">

			<!--{if $hotlist}-->
				<h4 class="et"><a href="home.php?mod=space&do=home&view=all&order=hot" class="y xw0">{lang view_more_hot} &rsaquo;</a>{lang recent_recommended_hot}</h4>
				<ul class="el">
				<!--{loop $hotlist $value}-->
				<!--{eval $value = mkfeed($value);}-->
				<!--{template home/space_feed_li}-->
				<!--{/loop}-->
				</ul>
			<!--{/if}-->

			<!--{if $list}-->
				<!--{loop $list $day $values}-->
					<!--{if $_GET['view']!='hot'}-->
						<h4 class="et">
							<!--{if $day=='yesterday'}-->{lang yesterday}<!--{elseif $day=='today'}-->{lang today}<!--{else}-->$day<!--{/if}-->
						</h4>
					<!--{/if}-->

					<ul class="el">
					<!--{loop $values $value}-->
						<!--{template home/space_feed_li}-->
					<!--{/loop}-->
					</ul>
				<!--{/loop}-->
			<!--{elseif $feed_users}-->
				<div class="xld xlda mtm">
				<!--{loop $feed_users $day $users}-->
				<h4 class="et">
					<!--{if $day=='yesterday'}-->{lang yesterday}<!--{elseif $day=='today'}-->{lang today}<!--{else}-->$day<!--{/if}-->
				</h4>
				<!--{loop $users $user}-->
				<!--{eval $daylist = $feed_list[$day][$user[uid]];}-->
				<!--{eval $morelist = $more_list[$day][$user[uid]];}-->
				<dl class="bbda cl">
					<dd class="m avt">
						<!--{if $user[uid]}-->
						<a href="home.php?mod=space&uid=$user[uid]" title="$user[username]" target="_blank"><!--{avatar($user[uid],small)}--></a>
						<!--{else}-->
						<img src="{IMGDIR}/systempm.gif" />
						<!--{/if}-->
					</dd>
					<dd class="cl">
						<ul class="el">
						<!--{loop $daylist $value}-->
							<!--{template home/space_feed_li}-->
						<!--{/loop}-->
						</ul>

						<!--{if $morelist}-->
						<p class="xg1 cl"><span onclick="showmore('$day', '$user[uid]', this);" class="unfold">{lang open}</span></p>
						<div id="feed_more_div_{$day}_{$user[uid]}" style="display:none;">
							<ul class="el">
							<!--{loop $morelist $value}-->
								<!--{template home/space_feed_li}-->
							<!--{/loop}-->
							</ul>
						</div>
						<!--{/if}-->
					</dd>
				</dl>
				<!--{/loop}-->
				<!--{/loop}-->
				</div>
			<!--{else}-->
				<p class="emp">{lang no_feed}</p>
			<!--{/if}-->

			<!--{if $filtercount}-->
				<div class="i" id="feed_filter_notice_{$start}">
					{lang depending_your}<a href="home.php?mod=spacecp&ac=privacy&op=filter">{lang filter_settings}</a>,{lang shield_feed_message} (<a href="javascript:;" onclick="filter_more($start);" id="a_feed_privacy_more">{lang click_view}</a>)
				</div>
				<div id="feed_filter_div_{$start}" style="display:none;">
					<h4 class="et">{lang following_feed_shielding}</h4>
					<ul class="el">
					<!--{loop $filter_list $value}-->
					<!--{template home/space_feed_li}-->
					<!--{/loop}-->
					<li><a href="javascript:;" onclick="filter_more($start);">&laquo; {lang pack_up}</a></li>
					</ul>
				</div>
			<!--{/if}-->

			</div>
			<!--/id=feed_div-->

<!--{if empty($diymode)}-->

			<!--{if $multi}-->
				<div class="pgs cl">$multi</div>
			<!--{/if}-->

			{hook/space_home_bottom}
				</div>
				<!--/class=bm-->
			</div>
			<div id="ajax_wait"></div>
		</div>
	</div>
	<!--/content-->

	<div class="sd">
		<!--{template common/userabout}-->

		<div class="drag">
			<!--[diy=diy2]--><div id="diy2" class="area"></div><!--[/diy]-->
		</div>

	</div>
	<!--/sidebar-->
</div>

<div class="wp mtn">
	<!--[diy=diy3]--><div id="diy3" class="area"></div><!--[/diy]-->
</div>

<!--{else}-->

			<!--{if $count==$perpage}-->
			<div class="pgs cl"><div class="pg"><a href="javascript:;" onclick="feed_more();" id="a_feed_more">{lang view_more_feed}</a></div></div>
			<!--{/if}-->
		</div>
	</div>
	<div class="sd">
		{subtemplate home/space_userabout}
	</div>
</div>
<!--{/if}-->

<!--{eval my_checkupdate();}-->

<script type="text/javascript">

	function filter_more(id) {
		if($('feed_filter_div_'+id).style.display == '') {
			$('feed_filter_div_'+id).style.display = 'none';
			$('feed_filter_notice_'+id).style.display = '';
		} else {
			$('feed_filter_div_'+id).style.display = '';
			$('feed_filter_notice_'+id).style.display = 'none';
		}
	}

	function close_feedbox() {
		var x = new Ajax();
		x.get('home.php?mod=spacecp&ac=common&op=closefeedbox', function(s){
			$('feed_box').style.display = 'none';
		});
	}

	function showmore(day, uid, e) {
		var obj = 'feed_more_div_'+day+'_'+uid;
		$(obj).style.display = $(obj).style.display == ''?'none':'';
		if(e.className == 'unfold'){
			e.innerHTML = '{lang pack_up}';
			e.className = 'fold';
		} else if(e.className == 'fold') {
			e.innerHTML = '{lang open}';
			e.className = 'unfold';
		}
	}

	var elems = selector('li[class~=magicthunder]', $('feed_div')); 
	for(var i=0; i<elems.length; i++){
		magicColor(elems[i]); 
	}
</script>

{subtemplate common/footer}
